package com.terrorism.first.utils;

import android.app.Activity;
import android.content.Context;
import android.util.DisplayMetrics;
import android.util.TypedValue;

public class Utils {
	public static int convertTodp(Context mContext, int num) {
		float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 1,
				mContext.getResources().getDisplayMetrics());
		return (int) (px * num);
	}
	
	public static int getScreenWith(Activity mcontext)
	{
		DisplayMetrics displaymetrics = new DisplayMetrics();
		mcontext.getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
		int height = displaymetrics.heightPixels;
		int width = displaymetrics.widthPixels;
		return width;
	}
}
